<template>
	<div class="Son-container">
		<h3>SonData子组件：父组件向子组件传值</h3>
		<p>msg:{{message}}</p>
		<p>user:{{userinfo}}</p>
		
	
		<button @click="message='abc'">msg</button>
	
	   <h4>向兄弟组件传递数据</h4>
	   <button @click="sendInfo">传值</button>
	
	</div>
</template>
   

<script>
	//导入公共的VU对象，在eventBus.js文件里
	import Bus from '../eventBus.js'
	
    export default{
		props:['message','userinfo'],
		data(){
			return {
				msg:this.message,
				info:'冬奥会短道速滑队'
			}
		},
		methods:{
			sendInfo(){
				Bus.$emit('share', this.info)
			}
		}

	}
</script>

<style lang="less" scoped>
	
	.Son-container {
	padding: 0 20px 20px;
	background-color: orange;
	min-height: 250px;
	flex: 1;
	}
	
	
</style>